# Contributor: André Klitzing <aklitzing@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=xbps
pkgver=0.59.2
pkgrel=0
pkgdesc="The X Binary Package System"
arch="all"
url="https://github.com/void-linux/xbps"
license="BSD-2-Clause AND (BSD-3-Clause AND ISC AND BSD-2-Clause-NetBSD)"
depends="ca-certificates"
makedepends="zlib-dev libarchive-dev openssl-dev>3"
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-zsh-completion
	"
options="!check"
source="$pkgname-$pkgver.tar.gz::https://github.com/void-linux/xbps/archive/$pkgver.tar.gz
	no-werror.patch
	"

# secfixes:
#   0.58-r0:
#     - CVE-2020-7450

build() {
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--bindir=/usr/bin \
		--localstatedir=/var/lib/xbps \
		--enable-lto
	sed 's|-O2|-Os|g' config.mk
	make
}

package() {
	make DESTDIR="$pkgdir/" install
	rm -f "$pkgdir"/usr/lib/*.a
}

sha512sums="
fb3179bfd36b89ed331d457c1fdb56deab8ad72b1834c08d0c808a8ec00dcbc3377052eac598e22e0840c19aac8bd6249a0855c8778d0da962b4b2f871a315ef  xbps-0.59.2.tar.gz
15db17c464732aa1da1970a9b7349321680feed2f8c17dff7dfc485d3d82696b66cee64056a51bfe6211e90fcf9b0abd6d6ae765f94670ba15d24419b5ea906f  no-werror.patch
"
